export default {
    clearStates(state) { /**清空缓存数据 */
        state.token = '';
        state.userInfo = '';
        state.isLogin = false;
        state.roomId = '';
        state.communityId = '';
        wx.clearStorageSync();
    },
    setToken(state, token) { /**设置用户登录权限 */
        state.token = token;
        wx.setStorageSync('token', token);
    },
    setUserInfo(state, userInfo) { /**设置用户信息 */
        state.userInfo = userInfo;
        wx.setStorageSync('userInfo', userInfo);
    },
    setIsLogin(state, isLogin) { /**修改用户登录状态 */
        state.isLogin = isLogin;
        wx.setStorageSync('isLogin', isLogin);
    },
    setRoomId(state, roomId) { /**修改用户所属房屋信息 */
        state.roomId = roomId;
        wx.setStorageSync('roomId', roomId);
    },
    setRoomIdName(state, roomIdName) { /**修改用户所属房屋信息 */
        state.roomIdName = roomIdName;
        wx.setStorageSync('roomIdName', roomIdName);
    },
    setCommunityId(state, communityId) { /**修改用户所属社区信息 */
        state.communityId = communityId;
        wx.setStorageSync('communityId', communityId);
    },
}